package com.torlesse.controller;

import com.torlesse.feign.UserClient;
import com.torlesse.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：torlesse
 * @date ：Created in 16:35 2021/8/8 0008
 * @description ：
 * @version: 1.0
 */
@RestController
@RequestMapping("/feign")
public class FeignController {
    @Autowired
    private UserClient userClient;

    @GetMapping("/{id}")
    public User findByUid(@PathVariable("id")Integer id){
        User user = userClient.findByUid(id);
        return user;
    }
}
